{% set project = app.generic.modelData('Projects', 'entity.id = :v1', { v1: param1 }) %}
{% set all_projects = app.generic.modelData('Projects', '', {}, { sort: 'rank', order: 'ASC' }) %}

{% extends 'base.twig' %}

{% block banner %}{% endblock %}

{% block content %}
	<div class="wrapper style2">
		<div class="inner">
			<div class="container">
				<div class="row">
					<div class="4u">
						<div id="sidebar">

							<!-- Sidebar -->
								<section>
									<header class="major">
										<h2>其他的作品</h2>
									</header>
									<ul class="style2">
										{% for itm in all_projects._data %}
											<li><a href="/portfolio-detail/{{ itm.id }}/">{{ itm.title }}</a></li>
										{% endfor %}
									</ul>
									<footer>
										<a href="#" class="button icon fa-arrow-circle-o-right">Do Something</a>
									</footer>
								</section>
					
						</div>
					</div>
					<div class="8u important(collapse)">
						<div id="content">

							<!-- Content -->
						
								<article>
									<header class="major">
										<h2>{{ project._data.0.title }}</h2>
										<p><a target="_blank" href="{{ project._data.0.url }}">{{ project._data.0.url|replace({ 'http://': '' }) }}</a></p>
									</header>
									
									{% set images = app.generic.modelData('Asset', 'entity.parentId = ' ~ project._data.0.gallery, {}, { sort: 'rank', order: 'ASC' }) %}
									{% if images._data|length > 0 %}
										<span class="image featured"><img src="/assets/image/{{ images._data.0.id }}/950/" alt="{{ project._data.0.title }}" /></span>
									{% endif %}
									
									{{ project._data.0.description|raw }}
								</article>
					
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
{% endblock %}
